package com.yonyou.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yonyou.dao.WinningListDAO;
import com.yonyou.domain.RequestWinningList;
import com.yonyou.domain.ResponseEntity;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 修正数据的方法
 * @author Administrator
 */
@RestController
@RequestMapping(value = "/corrected")
public class CorrectedController {
	
	@Autowired
	private WinningListDAO winningListDAO;
	
	/**
	 * 删除全部中奖人员名单
	 * @param requestWinningList
	 * @return
	 */
	@RequestMapping(value="/update",method = RequestMethod.POST)
	@ApiOperation(value = "删除全部中将人员名单",httpMethod ="POST", response = ResponseEntity.class,notes = "删除全部中将人员名单")
	public ResponseEntity<String> deleteWinninglist(@ApiParam(required = true, name = "paramData", value = "会议和奖项参数信息")@RequestBody RequestWinningList requestWinningList) {
		ResponseEntity<String> responseEntity = new ResponseEntity<String>();
		winningListDAO.deleteWinningList(requestWinningList.getMeeting_id(), requestWinningList.getPrize_id());
		try {
			responseEntity.setData(requestWinningList.getPrize_id());
			responseEntity.setCode(0);
			responseEntity.setErrmsg("");
		} catch (Exception e) {
			responseEntity.setCode(1);
			responseEntity.setErrmsg("系统异常");
		}
		return responseEntity;
	}
}
